<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h1>选择你喜欢的专栏</h1>
      <!-- 循环显示内容 -->
      <span v-for="(item,index) in arr"
        >
        <!-- 将标签与checked绑定 -->
        <input
          type="checkbox"
          v-model="item.checked"
          :key="index
        "
        />{{item.name}}</span
      >
      <ul>
        <li
          v-show="item.checked"
          v-for="(item,index) in arr"
          :key="index
        "
        >
          {{item.name}}
        </li>
      </ul>
    </div>
    <script src="../day02-准备代码/vue.js"></script>
    <script>
      const app = new Vue({
        el: '#app',
        data: {
          arr: [
            { name: '科幻', checked: false },
            { name: '喜剧', checked: false },
            { name: '动漫', checked: false },
            { name: '冒险', checked: false },
            { name: '科技', checked: false },
            { name: '军事', checked: false },
            { name: '娱乐', checked: false },
            { name: '奇闻', checked: false }
          ]
        }
      })
    </script>
  </body>
</html>
